NAND flash memory, as well as other types of non-volatile memories (“NVMs”), are commonly used in electronic devices for mass storage. For example, consumer electronics such as portable media players often include flash memory to store music, videos, and other media.
A block of a non-volatile memory may include both data that is needed by an electronic device (e.g., “valid data”) and data that is no longer needed by the electronic device (e.g., “invalid data”). In addition, valid data can be separated into data that is frequently updated or changed (e.g., “dynamic data”) and data that is rarely updated or changed (e.g., “static data”).
Some non-volatile memories are configured such that a block of programmed memory locations needs to be erased before any of the memory locations in the block can be reprogrammed. Therefore, electronic devices typically perform an operation referred to as “garbage collection” (“GC”) to free up blocks for erasing and reprogramming. To free up all of the memory locations in that block for erasing, the electronic device may copy the block's valid data into memory locations of another block. In some cases, garbage collection may be performed on a block that has the least amount of valid data, which may sometimes be referred to as a “least valid block”. In addition, electronic devices may also perform garbage collection on a block that has the least wear using an operation referred to as “wear leveling”.
When wear leveling is initiated on a first block of a non-volatile memory, the electronic device must copy all valid data of the first block to a second block, regardless of whether the data is dynamic or static. Unfortunately, although the dynamic data will eventually be deleted from the second block and updated at other locations in the non-volatile memory, the second block may still have valid static data even after a substantial period of time. Hence, this process may prevent the second block from becoming the least valid block, and consequently prevent garbage collection from being performed on the second block. Because the garbage collection process cannot be initiated on the second block, the free space of the second block may remain locked up and unavailable for reprogramming.